package session

import (
	"context"

	"gitee.com/linxing_3/sr-core/config/source"
	"gitee.com/linxing_3/sr-core/domain"
	"gitee.com/mkwchecking/sr-admin/apps/session/adapter/http"
	"gitee.com/mkwchecking/sr-admin/apps/session/conf"
)

var _ domain.IDomain = (*Session)(nil)

func NewSessionDomain() domain.IDomain {
	return &Session{}
}

type Session struct {
}

// Install implements domain.IDomain.
func (s *Session) Install(ctx context.Context, src source.ISource) error {
	conf.SetupConfig(src)

	if err := http.InitHttp(ctx); err != nil {
		return err
	}

	return nil
}

// BeforeStart implements domain.IDomain.
func (s *Session) BeforeStart(src source.ISource) error {
	return nil
}

// Start implements domain.IDomain.
func (s *Session) Start(ctx context.Context) error {
	return nil
}

// Stop implements domain.IDomain.
func (s *Session) Stop(ctx context.Context) error {
	return nil
}
